package com.qianf.qfoffice.service.impl;

import com.github.pagehelper.PageHelper;
import com.qianf.qfoffice.dao.StaffDao;
import com.qianf.qfoffice.entity.Staff;
import com.qianf.qfoffice.service.StaffService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class StaffServiceImpl implements StaffService {

    @Autowired
    private StaffDao staffDao;


    @Override
    public List<Staff> findAllStaff(Integer page, Integer limit) {

        PageHelper.startPage(page,limit);

        return staffDao.findAllStaff();
    }

    @Override
    public int addStaff(Staff staff) {
        return staffDao.addStaff(staff);
    }

    @Override
    public int deleteStaff(int id) {
        return staffDao.deleteStaff(id);
    }
}
